function createCounter(){
    let counter=0;

    const myFunction=function(){
        // 闭包
        counter=counter+1;
        // 词法作用域
        return counter;
    }
    return myFunction
}
const increment=createCounter();
const c1=increment();
const c2=increment();
const c3=increment();
console.log(c1,c2,c3);